home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Resources
/
PaperCut Quota 6.1
/
pc-setup.exe
/
{app}
/
WebAdmin
/
Transfer.asp
< prev
next >
Wrap
Text File
|
2005-07-05
|
3KB
|
124 lines
<%@ Language=VBScript %>
<%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %>
<!-- #INCLUDE FILE="includes/PCCommon.inc" -->
<!-- #INCLUDE FILE="includes/header.inc" -->
<%
Dim objPCWebUsers
Set objPCWebUsers = Server.CreateObject("PCWebAdmin.PCWebUsers")
If objPCWebUsers.Error Then
WriteErrorMessage objPCWebUsers.ErrorDescription
End If
Function GetTransferError(intError)
Dim s
If intError = 0 Then
' No error
s = ""
ElseIf intError = 1 Then
s = GetText("ErrorTransUser")
ElseIf intError = 2 Then
s = GetText("ErrorTransCredit")
ElseIf intError = 3 Then
s = GetText("ErrorTransInvAmount")
ElseIf intError = 4 Then
s = GetText("ErrorUnexpectedError")
s = s & " - " & objPCWebUsers.ErrorDescription
End If
GetTransferError = s
End Function
Dim strTransferTo
strTransferTo = LCase(Trim(Request("txtTransferTo")))
Dim curAmount
If (IsNumeric(Trim(Request("txtAmount")))) then
curAmount = CCur(Trim(Request("txtAmount")))
End If
If Not gblnIsLoggedIn Then
WriteErrorMessage GetText("ErrorUserNotLoggedIn") & " " & GetText("AnonAccessDisabled")
Else
objPCWebUsers.SeekUser(gstrLoggedInUser)
If (UCase(objPCWebUsers.UserName) <> UCase(gstrLoggedInUser)) then
' No match.
WriteErrorMessage GetTextReplace("ErrorCantFindUser", Array(gstrLoggedInUser))
Else
' Transfer
If Request("blnSubmitted") <> "" Then
If objPCWebUsers.TransferToUser(strTransferTo, curAmount, Trim(Request("txtComment"))) Then
RedirectWithMessage "default.asp", GetText("TransferApplied")
Else
WriteErrorMessage GetText("UnableToTransfer") & " " & GetTransferError(objPCWebUsers.ProcessErrorNo)
End If
End If
%>
<h1><%=GetText("TransferFunds")%></h1>
<%
' Find the details of the user
%>
<FORM ACTION="Transfer.asp" METHOD="POST" id="transferForm" name="transferForm">
<INPUT type="hidden" name=blnSubmitted value="T">
<TABLE class="webAdmin" width="550">
<TR class="evenRow">
<TH width="35%"><%=GetText("TransferFrom")%>:</TH>
<TD><%= objPCWebUsers.UserName %></TD>
</TR>
<TR class="oddRow">
<TH><%=GetText("AvailableFunds")%>:</TH>
<TD>
<%
Response.Write objPCWebUsers.CreditText
If objPCWebUsers.Unrestricted Then
Response.Write " (" & GetText("Unrestricted") & ")"
End If
%>
</TD>
</TR>
<TR class="evenRow">
<TH><%=GetText("AmountToTransfer")%>:</TH>
<TD>
<INPUT type="text" size="10" name="txtAmount" value="<%= FormatCredit(0) %>">
</TD>
</TR>
<TR class="oddRow">
<TH><%=GetText("TransferToUser")%>:</TH>
<TD>
<INPUT type="text" size="20" name="txtTransferTo" value="">
</TD>
</TR>
<TR class="evenRow">
<TH><%=GetText("Comment")%>:</TH>
<TD>
<INPUT type="text" size="50" name="txtComment" maxlength="255" value="<%=Server.HTMLEncode(Trim(Request("txtComment")))%>">
</TD>
</TR>
<TR class="evenRow">
<TD align=right colspan=2>
<INPUT type="submit" value="<%=GetText("Transfer")%>" name=cmdSave>
</TD>
</TR>
</TABLE>
</FORM>
<%
End If
End If
Set objPCWebUsers = Nothing
%>
</CENTER>
<!-- #INCLUDE FILE="includes/footer.inc" -->